perm filename LIT.VLI[VLI,LSP] blob
sn#382020 filedate 1978-09-08 generic text, type C, neo UTF8
COMMENT ā VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 (de lit (l d f)
C00003 ENDMK
Cā;
(de lit (l d f)
(if (null l) d
(f (car l) (lit (cdr l) d f))))
(de perms (l) (lit l [nil] 'foo))
(de foo (n l) (lit l nil (lambda (x y) (nconc (bar x) y))))
(de bar (x) (lit x [[n]] (lambda (a b) (cons (cons n x) (dcons a b)))))
(de mapconc (ll ff) (if ll (nconc (ff (nextl ll)) (mapconc ll ff))))
(de per (l)
(if (null l) [[]]
(let ((n (car l)) (l (per (cdr l))))
(mapconc l
(lambda (x)
(if (null x) [[n]]
(cons (cons n x) (dcons (car x)
(self (cdr x))))))))))